package com.bustle.user.dto.user;

import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;

import com.bustle.commons.MapConverter;
import com.bustle.commons.data.dao.Dao;
import com.bustle.commons.data.dto.DtoDao;
import com.bustle.user.data.User;
import com.bustle.user.data.dao.UserDao;

@Local
public interface UserDtoDao extends Dao<Integer, UserDto>
{
  @Stateless
  public class DefaultUserDtoDao extends DtoDao<Integer, UserDto, User> implements UserDtoDao
  {
    @Override
    protected Dao<Integer, User> getDao()
    {
      return userDao;
    }

    @Override
    protected MapConverter<UserDto, User> getDtoToDataMapConverter()
    {
      return dtoToUserConverter;
    }

    @Override
    protected MapConverter<User, UserDto> getDataToDtoMapConverter()
    {
      return userToDtoConverter;
    }

    @EJB
    protected UserDao userDao;
    @EJB
    protected DtoToUserMapConverter dtoToUserConverter;
    @EJB
    protected UserToDtoMapConverter userToDtoConverter;
  }
}
